/**
 * Quote Rotator - Simple jQuery plugin which cause a set of list
 * items to fade-in and fade-out. 
 * 
 * Homepage: http://coryschires.com/jquery-quote-rotator-plugin/
 * Source Code: https://github.com/coryschires/quote-rotator
 * 
 * Copyright (c) 2011 Cory Schires (coryschires.com)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 * Version: 1.0.0
 */
 (function(e){e.quote_rotator={defaults:{rotation_speed:4200,pause_on_hover:true,randomize_first_quote:false,buttons:false}};e.fn.extend({quote_rotator:function(t){var t=e.extend({},e.quote_rotator.defaults,t);return this.each(function(){var n;var r=e(this);var i=r.find("li");var s=true;var o=t.rotation_speed<2e3?2e3:t.rotation_speed;var u=function(){var n=r.find("li.active").length===0;if(t.randomize_first_quote){var s=e(i[Math.floor(Math.random()*i.length)]);s.addClass("active")}else if(n){r.find("li:first").addClass("active")}}();var a=function(e){return e.next("li").length?e.next("li"):r.find("li:first")};var f=function(e){return e.prev("li").length?e.prev("li"):r.find("li:last")};var l=function(e){var t=r.find("li.active");var n=e==="forward"?a(t):f(t);t.animate({opacity:0},1e3,function(){t.hide();i.css("opacity",1);n.fadeIn(1e3)});t.removeClass("active");n.addClass("active")};var c=function(){n=setInterval(function(){if(s){l("forward")}},o)};var h=function(){r.hover(function(){s=false},function(){s=true})};var p=function(){r.append('<div class="qr_buttons">              <button class="qr_previous">'+t.buttons.previous+'</button>              <button class="qr_next">'+t.buttons.next+"</button>            </div>");r.find("button").click(function(){clearInterval(n);l(e(this).hasClass("qr_next")?"forward":"backward");c()})};if(t.buttons){p()}if(t.pause_on_hover){h()}i.not(".active").hide();c()})}})})(jQuery)